import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf

def tensorflow_demo():
    """
    Tensorflow 基本结构
    :return:
    """

    # 测试 gpu 是否可用
    print(tf.config.list_physical_devices('GPU'))

    # tensorflow实现加法运算
    a = tf.constant(2)
    b = tf.constant(3)
    t = a + b
    print("t：", t)

    return None

if __name__ == "__main__":
    # 代码1：Tensorflow 基本结构
    tensorflow_demo()